﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;

namespace EasyDDD.Domain.User
{
    /// <summary>
    /// 角色拥有的权限
    /// </summary>
    public class ApplicationRoleClaim
    //: DomainEntity<Guid>
    {
        [JsonConstructor]
        public ApplicationRoleClaim() { }

        public virtual Guid Id { get; set; } = default!;

        /// <summary>
        /// Gets or sets the of the primary key of the role associated with this claim.
        /// </summary>
        [ForeignKey(nameof(ApplicationRole))]
        public virtual Guid RoleId { get; set; } = default!;
        public virtual ApplicationRole ApplicationRole { get; set; } = default!;

        /// <summary>
        /// Gets or sets the claim type for this claim.
        /// </summary>
        [StringLength(128)]
        public virtual string ClaimType { get; set; } = string.Empty;

        /// <summary>
        /// Gets or sets the claim value for this claim.
        /// </summary>
        [StringLength(512)]
        public virtual string ClaimValue { get; set; } = string.Empty;

    }
}
